package com.cee.admin.log.util;


import com.cee.admin.log.aop.OperateLogAspect;
import com.cee.domain.modules.sys.entity.SysUserOperationLog;

import java.util.function.Consumer;

/**
 * 操作日志工具类
 * 目前主要的作用，是提供给业务代码，记录操作明细和拓展字段
 *
 * @author 芋道源码
 */
public class OperateLogUtils {

    public static void setContent(String content) {
        OperateLogAspect.setContent(content);
    }

    public static void addExt(String key, Object value) {
        OperateLogAspect.addExt(key, value);
    }

    public static void setLogPreprocessor(Consumer<SysUserOperationLog> consumer) {
        OperateLogAspect.addLogPreprocessor(consumer);
    }

    /**
     * 停止本次记录
     */
    public static void disableCurrentLog() {
        OperateLogAspect.disableCurrentLog();
    }
}
